Skip to content

Close the launch OSD only after its show call finishes - #18453

Open
neotyk wants to merge 2 commits into
omacom:quattrofrom
neotyk:fix-launch-osd-race
Open

neotyk wants to merge 2 commits into
omacom:quattrofrom
neotyk:fix-launch-osd-race

Conversation

@neotyk

@neotyk neotyk commented Nov 11, 2026

Copy link
Copy Markdown

What changes

Sometimes the "Launching …" OSD never goes away. It stays on screen after the app's window has opened, until something closes it by hand (omarchy-shell osd close). I hit this with Slack.

The launch OSD shows with duration: 0, so only closeLaunchFeedback() can close it. Show and close each ran as a separate detached omarchy-shell process, and nothing kept them in order. When the window appeared just after the 2 s delay, close could reach the OSD before show did. The 15 s timeout did not help, because launchOsdOpen was already false.

The show call now runs through a Process. If close comes in while show is still running, it waits until show exits.

Verification

  • New test/shell.d/launch-osd-order-test.sh stubs omarchy-shell so that osd show takes 0.5 s, then closes the launch feedback as soon as the OSD opens.
    • Without the fix it fails, with calls in the order close show.
    • With the fix it passes, with show close. It passed 3 runs in a row.
  • qmllint reports no new warnings for AppLibrary.qml.
  • I did not run the full ./test/all suite. I have not tried the patched shell as my live desktop shell.

Screenshots

No visible change: this fixes a timing bug, and the OSD looks the same.

🤖 Generated with Claude Code

The launch OSD shows with no duration, and show and close each ran as a
detached omarchy-shell call. When the app's window appeared just after the
2s delay, close could reach the OSD before show did and leave it open for
good; the 15s timeout could not help because the OSD already counted as
closed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the previous fixture failure is fixed.

Summary

The PR makes the launch OSD wait for its show call to finish before sending a queued close.

  • The launch OSD closes after its show request finishes.

Reviews (2) · Last reviewed commit: "Track the pending launch OSD show withou..." · Reviewed by Greptile

A Process does not report running until it has started, so a close in the
same turn as the show still went out first. Track the pending show with a
flag of our own, and move the show into showLaunchOsd() so the test can show
and close in one turn, without real desktop window changes cancelling the
launch first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added the bug Something isn't working label Nov 17, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks for tracking this down, @neotyk. The cause you describe is right: show and close go out as two detached omarchy-shell calls, nothing orders them, and the duration: 0 OSD stays up when the close wins.

This PR is one of several open fixes for the same bug, and the maintainer will pick one. I compared it with #9819, #13606, #15475, #16883 and #18678 by reading their diffs against quattro. Codex Medium and muse-wonder (via pi, thinking high) each chose a winner on their own, without my answer, and both picked #9819, as I did. Their agreement is not guaranteed to be independent of my reasoning.

Why #9819. It is the oldest of these (opened 2 September) and it fixes the same cause more completely. It calls the shell's in-process summon() and hide(), the way BrightnessKeys drives the same OSD, so no omarchy-shell process is involved. That keeps show and close in order, and a close can no longer be lost to the 2 s IPC timeout in bin/omarchy-shell. It also gives the toast a finite duration as a backstop. It was reproduced and verified on a worker in October, and it still merges cleanly.

What this one leaves open. Waiting for the show to exit fixes the ordering, but the queued close at shell/services/AppLibrary.qml:291 is still a detached omarchy-shell osd close. If that call times out on a loaded machine, which is when this bug shows up, the OSD was shown with duration: 0 (:192). closeLaunchFeedback() has already stopped launchTimeout and cleared launchOsdOpen (:198–:203), so nothing closes it. Both reviewers raised this, and it holds against the code.

I didn't run anything on a worker for this PR: verifying a fix the maintainer won't merge would spend a worker on nothing. Your regression test drives showLaunchOsd() and a stubbed omarchy-shell, and neither exists in #9819's approach, so there is nothing here to fold into it.

This is waiting on the maintainer, who decides between the competing fixes.

@chessing234

Copy link
Copy Markdown
Contributor

both of your commits are in #21025. close waits while the show is still pending, including before running turns true. the close that then runs is closeLaunch with the launch serial from #16883. @dhh @omarchybot if 21025 lands, this can close as superseded.

@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks, @neotyk. I checked both commits and the regression test against quattro. Since #9819 landed in 3df6c5d535, the launcher shows and hides the OSD in-process and gives it a 13-second expiry. The test uses showLaunchOsd() and stubs the old omarchy-shell calls, so it would need to be rewritten to cover the current launch path. #21025 carries both commits on its integration branch.

GPT-6.2 Sol High in Codex and Opus 5.5 High agreed after reading the source. The second reviewer could see the same session context. Closure is with the maintainer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants